<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

	<ui:define name="body">

		<h:messages globalOnly="true" styleClass="message" id="globalMessages" />

		<rich:panel>
			<f:facet name="header">Statusi zahteva za kredit</f:facet>

			<s:decorate id="datum" template="layout/display.xhtml">
				<ui:define name="label">Datum statusa</ui:define>
	           #{statusZahtevaHome.instance.datum}
	        </s:decorate>

			<div style="clear: both" />

		</rich:panel>

		<div class="actionButtons">
			<s:button  	view="/StatusZahtevaEdit.xhtml" 
						  id="edit" 
					   value="Izmeni" /> 
			<s:button	view="/#{empty statusZahtevaFrom ? 'StatusZahtevaList' : statusZahtevaFrom}.xhtml"
						  id="done" 
					   value="Nazad" /></div>

<rich:panel>
	<f:facet name="header">Podaci o kreditnom zahtevu</f:facet>
    <div class="association" id="kreditniZahtevParent">
     
				<rich:dataTable var="kreditniZahtev"
					value="#{statusZahtevaHome.instance.kreditniZahtev}"
					rendered="#{statusZahtevaHome.instance.kreditniZahtev != null}"
					rowClasses="rvgRowOne,rvgRowTwo" id="kreditniZahtevTable">

					<h:column>
						<f:facet name="header">Broj zahteva</f:facet>
		                #{kreditniZahtev.brojZahteva}
		            </h:column>
					<h:column>
						<f:facet name="header">Datum zahteva</f:facet>
		               	#{kreditniZahtev.datumZahteva}
		            </h:column>
					<h:column>
						<f:facet name="header">Iznos kredita</f:facet>
		                #{kreditniZahtev.iznos} (#{kreditniZahtev.valuta.oznaka})
		            </h:column>
					<h:column>
						<f:facet name="header">Iznos rate</f:facet>
		                #{kreditniZahtev.iznosRate} (#{kreditniZahtev.valuta.oznaka})
		            </h:column>
					<h:column>
						<f:facet name="header">Iznos ucesca</f:facet>
		                #{kreditniZahtev.iznosUcesca}
		            </h:column>
					<h:column>
						<f:facet name="header">Namena kredita</f:facet>
				    	#{kreditniZahtev.namena.naziv}
		            </h:column>
					<h:column>
						<f:facet name="header">Rok kredita</f:facet>
		                #{kreditniZahtev.rok} #{kreditniZahtev.tipRocnosti.id}
		            </h:column>
					<h:column>
						<f:facet name="header">Trenutni status</f:facet>
				    	#{kreditniZahtev.status.naziv}
		            </h:column>					
					<h:column>
						<f:facet name="header">Akcije</f:facet>
						<s:link id="viewkreditniZahtev" value="View"
							view="/KreditniZahtev.xhtml">
							<f:param name="kreditniZahtevId" value="#{kreditniZahtev.id}" />
						</s:link>
					</h:column>
				</rich:dataTable>

		</div>	
	</rich:panel>	
	
	<rich:panel>
		<f:facet name="header">Podaci o statusu kreditnog zahteva na datum #{statusZahtevaHome.instance.datum}</f:facet>
		 <div class="association" id="statusParent">
				<rich:dataTable
					var="status" value="#{statusZahtevaHome.instance.status}"
					rendered="#{statusZahtevaHome.instance.status != null}"
					rowClasses="rvgRowOne,rvgRowTwo" id="statusTable">
					<h:column>
						<f:facet name="header">id</f:facet>
                		#{status.id}
		            </h:column>
					<h:column>
						<f:facet name="header">naziv</f:facet>
		                #{status.naziv}
		            </h:column>
					<h:column>
						<f:facet name="header">action</f:facet>
						<s:link id="viewstatus" value="View" view="/Status.xhtml">
							<f:param name="statusId" value="#{status.id}" />
						</s:link>
					</h:column>
				</rich:dataTable>
				
        
    </div>
</rich:panel>
  
	    
	</ui:define>

</ui:composition>
